home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / tls / tls088.hpux.Z / tls088.hpux / lib / vtcl / tests / focus2.tcl < prev    next >
Encoding:
Text File  |  1995-07-20  |  845 b   |  36 lines

  1. # CVS $Id: focus2.tcl,v 1.3 1995/02/03 16:54:38 zibi Exp $
  2. #
  3. # Simple test of VtSetFocus
  4. #
  5. # This test setting focus in a text field's activate callback.
  6. # Remember that text fields are a tab group.
  7. #
  8. proc focusCB {cbs} {
  9.     set target [keylget cbs widget]
  10.  
  11.     VtSetFocus $target -direction NEXT_TAB_GROUP
  12. }
  13.  
  14. set ap [VtOpen focus]
  15.  
  16. set dlog [VtFormDialog $ap.form]
  17.  
  18. VtLabel $dlog.lab -labelLeft -font medPlainFont \
  19.  -label "This test a common focus problem,
  20. hitting the return key in each text field
  21. will select the next text field."
  22.  
  23. set frame [VtFrame $dlog.frame -title "Bunch Of Text" -MOTIF_topOffset 10]
  24. set rc0 [VtRowColumn $frame.rc0 -vertical -rightSide FORM]
  25.  
  26. foreach txt {a b c d e} {
  27.     VtText $rc0.$txt -activateCallback "focusCB"
  28. }
  29.  
  30. VtPushButton $rc0.quit -label Quit -callback { VtClose ;exit 0 ;#}
  31.  
  32. VtShow $dlog
  33.  
  34. VtMainLoop
  35.  
  36.